package com.hmall.order.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hmall.common.client.ItemClient;
import com.hmall.common.client.UserClient;
import com.hmall.common.dto.Item;
import com.hmall.order.mapper.OrderDetailMapper;
import com.hmall.order.pojo.OrderDetail;
import com.hmall.order.service.IOrderDetailService;
import com.hmall.order.service.IOrderService;
import com.hmall.order.vo.ResultParams;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author Azer
 * @LOVE,,,
 * @Date 2021/11/8 20:01
 */
@Service
public class OrderDetailService extends ServiceImpl<OrderDetailMapper, OrderDetail> implements IOrderDetailService {
//    @Autowired
//    private ItemClient itemClient;
//
//    @Autowired
//    private IOrderService orderService;
//
//
//    @Override
//    public void getOrderDetail(ResultParams params) {
//
//        //根据itemId查询商品信息
//        Item item = itemClient.QueryById(params.getItemId());
//        //将商品信息、orderId信息封装为OrderDetail对象，写入tb_order_detail表
//        OrderDetail orderDetail=new OrderDetail();
//        orderDetail.setItemId(params.getItemId());
//        orderDetail.setNum(params.getNum());
//        orderDetail.setName(item.getName());
//        orderDetail.setSpec(item.getSpec());
//        orderDetail.setPrice(item.getPrice());
//        orderDetail.setImage(item.getImage());
//        Long orderId = orderService.getOrder(params);
//        orderDetail.setOrderId(orderId);
//
//        this.save(orderDetail);
//    }
}
